import React, {PureComponent} from 'react'
import {Icon} from 'antd-mobile'
import propTypes from 'prop-types'

class Loading extends PureComponent {
  render() {
    const {className} = this.props

    return (
      <div
        className={'flex-row justify-center align-center' + (className ? ` ${className}` : '')}
        style={{
          padding: '5px 0'
        }}
      >
        <Icon type="loading" size="sm" />
        <span
          style={{
            margin: '0 0 0 3px'
          }}
        >加载中...</span>
      </div>
    )
  }
}

Loading.propsTypes = {
  className: propTypes.string
}

export default Loading
